﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace card
{
    public partial class Drivers : Form
    {
        public Drivers()
        {
            InitializeComponent();
        }
        public static DataSet divers = null;//用来保存从登记页面传过来的司机列表信息

        private void Drivers_Load(object sender, EventArgs e)
        {
            if (divers != null)
            {
                this.dataGridView1.AutoGenerateColumns = true;
                this.dataGridView1.AllowUserToAddRows = false;
                this.dataGridView1.DataSource = divers.Tables[0];
            }
        }
        public string driver_name = "";
        public string driver_id = "";
        public string driver_phone = "";
        private void Drivers_FormClosed(object sender, FormClosedEventArgs e)
        {
            if (this.dataGridView1.CurrentRow != null)
            {
                driver_name = this.dataGridView1.CurrentRow.Cells["姓名"].Value.ToString();
                driver_id = this.dataGridView1.CurrentRow.Cells["身份证"].Value.ToString();
                driver_phone = this.dataGridView1.CurrentRow.Cells["电话"].Value.ToString();
            }
        }

        private void dataGridView1_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar == (char)13)
            {
                this.Close();
            }
        }
    }
}
